/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package javagameengine;

import java.awt.Color;
import java.awt.Graphics2D;
import java.util.ArrayList;

/**
 *
 * @author jimi
 */
public class Shape
{

	public ArrayList verts = new ArrayList();
	public Color color;

	void draw( Graphics2D g, Matrix transform )
	{
		Color temp = g.getColor();
		g.setColor( color );
		for( int i = 0 ; i < verts.size() ; i++ )
		{
			Point p = transform.times( (Point)verts.get( i ) );//.get_render() ;

			//Point p_ = Matrix.pers( RenderScreen.current.camera, p, new Point(), Vector.k ) ;

			//p = p_.get_render() ;

			Point p2 = transform.times( (Point)verts.get( ( i + 1 ) % verts.size() ) );//.get_render() ;

			//p_ = Matrix.pers( RenderScreen.current.camera, p2, new Point(), Vector.k ) ;

			//p2 = p_.get_render() ;

			//	System.out.println( "p is " + p.x + " " + p.y + " " + p.z ) ;
			//	System.out.println( "p2 is " + p2.x + " " + p2.y + " " + p2.z ) ;

			g.drawLine( (int)p.x, (int)p.y, (int)p2.x, (int)p2.y );
		}
		g.setColor( temp );
	}
}
